<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>
<%@ page import="tw.com.msig.b2c.car.product.vo.PdtInsItemVo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<jsp:include page="/layout/meta.jsp"/>
</head>

<body>
	<div id="header">
		<jsp:include page="/layout/header.jsp"/>
	</div>
	
	<div id="navigator">
		<jsp:include page="/layout/navigator.jsp"/>
	</div>
	
	<div id="container">
			<ol class="breadcrumb">
    			<li>商品設定</li>
				<li>保險項目</li>
			</ol>
			<h3>保險項目管理</h3>
			
			<a href="<%=request.getContextPath()%>/product/insitem.do?sActionType=add" class="btn btn-sm btn-primary" 
				data-loading-text="Loading" id="addBtn">新增</a>
			
			<table id="resultTable" class="table table-striped table-bordered">
				<thead>
					<tr>
						<th style="width: 150px">功能</th>
						<th style="width: 150px">Code</th>
						<th style="width: 150px">Description</th>
						<th style="width: 150px">Amounts</th>
					</tr>
				</thead>
				<tbody>
					<%
						List<PdtInsItemVo> models = (List<PdtInsItemVo>) request.getAttribute("models");
						for(PdtInsItemVo model:models) {
							pageContext.setAttribute("model", model);
					%>
						<tr>
							<td><a href="<%=request.getContextPath()%>/product/insitem.do?sActionType=edit&id=<%=model.getId()%>"
								class="btn btn-sm btn-success" data-loading-text="Loading"
								id="editBtn_<%=model.getId()%>">修改</a>
								<a
								href="<%=request.getContextPath()%>/product/insitem.do?sActionType=delete&id=<%=model.getId()%>"
								class="btn btn-sm btn-danger" data-loading-text="Loading"
								id="deleteBtn_<%=model.getId()%>">刪除</a>
							<td>${model.code}</td>
							<td>${model.description}</td>
							<td>${model.amounts}</td>
						</tr>
					<%		
						}
					%>
				</tbody>
			</table>
	</div>

</body>
</html>